# Created by: Olivier Duchateau
# $FreeBSD$
#

PORTNAME=	transmageddon
PORTVERSION=	0.25
CATEGORIES=	multimedia
MASTER_SITES=	http://www.linuxrising.org/files/

MAINTAINER=	olivierd@FreeBSD.org
COMMENT=	Video converter using GStreamer

LIB_DEPENDS=	notify:${PORTSDIR}/devel/libnotify

USE_XZ=	yes
GNU_CONFIGURE=	yes
USE_GMAKE=	yes
USES=	pkgconfig gettext shebangfix
INSTALLS_ICONS=	yes
USE_PYTHON=	2.7
USE_GNOME=	pygobject3
USE_GSTREAMER1=	core faac faad flac libav mad mpeg2enc mpeg2dec ogg speex \
	theora vorbis vpx x264

CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib

# Replace Bash by Bourne shell
bash_CMD=	/bin/sh
SHEBANG_FILES=	bin/transmageddon.in


MAN1=	transmageddon.1

post-patch:
# We use Python 2.x, because devel/py-gobject3 fails
# (when PYTHON_DEFAULT_VERSION is greater than 3.x).
# Python3 binding for Cairo is missing (there's only for Python2).
	@${REINPLACE_CMD} -e 's|\.\.\/\.\.|${PREFIX}|g ;\
		s|python3|python|' \
		${WRKSRC}/src/transmageddon.py
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
		${WRKSRC}/src/transcoder_engine.py
	@${REINPLACE_CMD} -e 's|python3|${PYTHON_CMD}|' \
		${WRKSRC}/bin/transmageddon.in

.include <bsd.port.mk>
